package com.locatead.proto.model;

import java.util.Date;

import javax.jdo.annotations.PersistenceCapable;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement
@XmlAccessorType(javax.xml.bind.annotation.XmlAccessType.FIELD)
@PersistenceCapable
public class Cell {
	
	private String id;
	private Integer x;
	private Integer y;
	private Date registered;
	private Date modified;
	private Date expired;
	private String owner;
	private String reseller;
	
	public Cell(String id, Integer x, Integer y, Date registered, Date modified, Date expired, String owner, String reseller) {
		super();
		this.x = x;
		this.y = y;
		this.registered = registered;
		this.modified = modified;
		this.expired = expired;
		this.owner = owner;
		this.reseller = reseller;
		
		StringBuffer sb = new StringBuffer();
		sb.append(x); sb.append(","); sb.append(y);
		this.id = sb.toString();
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public Integer getX() {
		return x;
	}

	public void setX(Integer x) {
		this.x = x;
	}

	public Integer getY() {
		return y;
	}

	public void setY(Integer y) {
		this.y = y;
	}

	public Date getRegistered() {
		return registered;
	}

	public void setRegistered(Date registered) {
		this.registered = registered;
	}

	public Date getModified() {
		return modified;
	}

	public void setModified(Date modified) {
		this.modified = modified;
	}

	public Date getExpired() {
		return expired;
	}

	public void setExpired(Date expired) {
		this.expired = expired;
	}

	public String getOwner() {
		return owner;
	}

	public void setOwner(String owner) {
		this.owner = owner;
	}

	public String getReseller() {
		return reseller;
	}

	public void setReseller(String reseller) {
		this.reseller = reseller;
	}

	@Override
	public String toString() {
		return "Cell [id=" + id + ", x=" + x + ", y=" + y + ", registered="
				+ registered + ", modified=" + modified + ", expired="
				+ expired + "]";
	}
}
